<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app">
    <div>{{msg}}</div>
    <div>{{reseverMsg}}</div>
    <div>{{agese}}</div>
  </div>
  <script src="../vue.js"></script>
  <script>
    var vm = new Vue({
      el: '#app',
      data: {
        msg: 'hello',
        age: 17
      },
      computed: {
        reseverMsg: function () {
          return this.msg.split('').reverse().join('')
        },
        agese: function () {
          return this.age >= 18 ? '我成年了' : '我还没有成年'
        }
      }
    })
  </script>
</body>

</html>